# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>

pkgname=libsvgtiny
pkgver=0.1.7
pkgrel=4
pkgdesc='SVG Tiny library'
arch=(loong64 x86_64)
url='https://www.netsurf-browser.org/projects/libsvgtiny/'
license=(MIT)
makedepends=(netsurf-buildsystem git libwapcaplet libdom gperf)
depends=('libdom>=0.3.3')
source=("git+https://git.netsurf-browser.org/libsvgtiny.git#tag=release/$pkgver")
md5sums=('SKIP')

prepare() {
  sed -i 's:_BSD_SOURCE:_DEFAULT_SOURCE:' "$pkgname/Makefile"
}

build() {
  export CFLAGS="$CFLAGS -shared -fPIC -w"
  export LDFLAGS="$LDFLAGS -shared"
  make -C $pkgname \
    INCLUDEDIR=include \
    LIBDIR=lib \
    PREFIX=/usr \
    COMPONENT_TYPE=lib-shared
}

package() {
  make -C $pkgname \
    DESTDIR="$pkgdir" \
    INCLUDEDIR=include \
    LIBDIR=lib \
    PREFIX=/usr \
    COMPONENT_TYPE=lib-shared \
    install
  install -Dm644 $pkgname/COPYING \
    "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

# getver: source.netsurf-browser.org/libsvgtiny.git
# vim: ts=2 sw=2 et:
